using System;
using System.Collections;

namespace PharmacyPharnet.Core.Entity
{
	public class TypeInfoCollection : CollectionBase
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="GUIInfoCollection"/> class.
		/// </summary>
		public TypeInfoCollection()
		{
		}

		public void Add(TypeInfo info)
		{
			if (InnerList.IndexOf(info) < 0)
			{
				List.Add(info);
			}
		}

		public TypeInfo this[int id]
		{
			get
			{
				foreach (TypeInfo info in InnerList)
				{
					if (info.Id == id)
					{
						return info;
					}
				}
				return null;
			}
		}
	}
}
